import 'dart:io';

import 'package:flutter/material.dart';

/****
 * 上传图片需要的文件
 */
class  Love_ImageView extends  StatefulWidget {
  const Love_ImageView({Key key}) :super(key: key);

  @override
  _Love_ImageViewState createState() => _Love_ImageViewState();
}
 class  _Love_ImageViewState  extends State<Love_ImageView>{

   File  _image;
   final   picker=ImagePicker();
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
//      appBar:  ge("图片列表"),
    floatingActionButton: FloatingActionButton(onPressed: (){},
    child: Icon(Icons.camera_alt),
    ),
    );
  }
Future  getImae() async{

    final  pickedFile=await picker.getImage(souece:ImageSource.camera);
    setState(() {
      if(pickedFile!=null){
        _image=File(pickedFile.path);
      }else{
        print('no  image selected');
      }
    });


}


 }